<?php

namespace App\Ship\Cryptopro;

class Constants
{
    const MEMORY_STORE = 0;
    const LOCAL_MACHINE_STORE = 1;
    const CURRENT_USER_STORE = 2;
    const ACTIVE_DIRECTORY_USER_STORE = 3;
    const SMART_CARD_USER_STORE = 4;

    const STORE_OPEN_READ_ONLY = 0;
    const STORE_OPEN_READ_WRITE = 1;
    const STORE_OPEN_MAXIMUM_ALLOWED = 2;
    const STORE_OPEN_EXISTING_ONLY = 128;
    const STORE_OPEN_INCLUDE_ARCHIVED = 256;

    const CERTIFICATE_FIND_SHA1_HASH = 0;
    const CERTIFICATE_FIND_SUBJECT_NAME = 1;
    const CERTIFICATE_FIND_ISSUER_NAME = 2;
    const CERTIFICATE_FIND_ROOT_NAME = 3;
    const CERTIFICATE_FIND_TEMPLATE_NAME = 4;
    const CERTIFICATE_FIND_EXTENSION = 5;
    const CERTIFICATE_FIND_EXTENDED_PROPERTY = 6;
    const CERTIFICATE_FIND_APPLICATION_POLICY = 7;
    const CERTIFICATE_FIND_CERTIFICATE_POLICY = 8;
    const CERTIFICATE_FIND_TIME_VALID = 9;
    const CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10;
    const CERTIFICATE_FIND_TIME_EXPIRED = 11;
    const CERTIFICATE_FIND_KEY_USAGE = 12;

    const CERT_INFO_SUBJECT_SIMPLE_NAME = 0;
    const CERT_INFO_ISSUER_SIMPLE_NAME = 1;
    const CERT_INFO_SUBJECT_EMAIL_NAME = 2;
    const CERT_INFO_ISSUER_EMAIL_NAME = 3;
    const CERT_INFO_SUBJECT_UPN = 4;
    const CERT_INFO_ISSUER_UPN = 5;
    const CERT_INFO_SUBJECT_DNS_NAME = 6;
    const CERT_INFO_ISSUER_DNS_NAME = 7;

    const DIGITAL_SIGNATURE_KEY_USAGE = 128;
    const NON_REPUDIATION_KEY_USAGE = 64;
    const KEY_ENCIPHERMENT_KEY_USAGE = 32;
    const DATA_ENCIPHERMENT_KEY_USAGE = 16;
    const KEY_AGREEMENT_KEY_USAGE = 8;
    const KEY_CERT_SIGN_KEY_USAGE = 4;
    const OFFLINE_CRL_SIGN_KEY_USAGE = 2;
    const CRL_SIGN_KEY_USAGE = 2;
    const ENCIPHER_ONLY_KEY_USAGE = 1;
    const DECIPHER_ONLY_KEY_USAGE = 32768;

    const ENCODE_BASE64 = 0;
    const ENCODE_BINARY = 1;
    const ENCODE_ANY = 0xffffffff;

    const CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0;
    const CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1;
    const CADESCOM_ENCRYPTION_ALGORITHM_DES = 2;
    const CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3;
    const CADESCOM_ENCRYPTION_ALGORITHM_AES = 4;
    const CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25;

    const ENCRYPTION_KEY_LENGTH_MAXIMUM = 0;
    const ENCRYPTION_KEY_LENGTH_40_BITS = 1;
    const ENCRYPTION_KEY_LENGTH_56_BITS = 2;
    const ENCRYPTION_KEY_LENGTH_128_BITS = 3;
    const ENCRYPTION_KEY_LENGTH_192_BITS = 4;
    const ENCRYPTION_KEY_LENGTH_256_BITS = 5;

    const EKU_OTHER = 0;
    const EKU_SERVER_AUTH = 1;
    const EKU_CLIENT_AUTH = 2;
    const EKU_CODE_SIGNING = 3;
    const EKU_EMAIL_PROTECTION = 4;
    const EKU_SMARTCARD_LOGON = 5;
    const EKU_ENCRYPTING_FILE_SYSTEM = 6;

    const SEX_NOT_KNOWN = 0;
    const SEX_MALE = 1;
    const SEX_FEMALE = 2;
    const SEX_NOT_APPLICABLE = 9;

    const PROV_RSA_FULL = 1;
    const PROV_RSA_SIG = 2;
    const PROV_DSS = 3;
    const PROV_FORTEZZA = 4;
    const PROV_MS_EXCHANGE = 5;
    const PROV_SSL = 6;
    const PROV_RSA_SCHANNEL = 12;
    const PROV_DSS_DH = 13;
    const PROV_EC_ECDSA_SIG = 14;
    const PROV_EC_ECNRA_SIG = 15;
    const PROV_EC_ECDSA_FULL = 16;
    const PROV_EC_ECNRA_FULL = 17;
    const PROV_DH_SCHANNEL = 18;
    const PROV_SPYRUS_LYNKS = 20;
    const PROV_RNG = 21;
    const PROV_INTEL_SEC = 22;
    const PROV_REPLACE_OWF = 23;
    const PROV_RSA_AES = 24;

    const KEY_SPEC_KEYEXCHANGE = 1;
    const KEY_SPEC_SIGNATURE = 2;

    const OID_OTHER = 0;
    const OID_AUTHORITY_KEY_IDENTIFIER_EXTENSION = 1;
    const OID_KEY_ATTRIBUTES_EXTENSION = 2;
    const OID_CERT_POLICIES_95_EXTENSION = 3;
    const OID_KEY_USAGE_RESTRICTION_EXTENSION = 4;
    const OID_LEGACY_POLICY_MAPPINGS_EXTENSION = 5;
    const OID_SUBJECT_ALT_NAME_EXTENSION = 6;
    const OID_ISSUER_ALT_NAME_EXTENSION = 7;
    const OID_BASIC_CONSTRAINTS_EXTENSION = 8;
    const OID_SUBJECT_KEY_IDENTIFIER_EXTENSION = 9;
    const OID_KEY_USAGE_EXTENSION = 10;
    const OID_PRIVATEKEY_USAGE_PERIOD_EXTENSION = 11;
    const OID_SUBJECT_ALT_NAME2_EXTENSION = 12;
    const OID_ISSUER_ALT_NAME2_EXTENSION = 13;
    const OID_BASIC_CONSTRAINTS2_EXTENSION = 14;
    const OID_NAME_CONSTRAINTS_EXTENSION = 15;
    const OID_CRL_DIST_POINTS_EXTENSION = 16;
    const OID_CERT_POLICIES_EXTENSION = 17;
    const OID_POLICY_MAPPINGS_EXTENSION = 18;
    const OID_AUTHORITY_KEY_IDENTIFIER2_EXTENSION = 19;
    const OID_POLICY_CONSTRAINTS_EXTENSION = 20;
    const OID_ENHANCED_KEY_USAGE_EXTENSION = 21;
    const OID_CERTIFICATE_TEMPLATE_EXTENSION = 22;
    const OID_APPLICATION_CERT_POLICIES_EXTENSION = 23;
    const OID_APPLICATION_POLICY_MAPPINGS_EXTENSION = 24;
    const OID_APPLICATION_POLICY_CONSTRAINTS_EXTENSION = 25;
    const OID_AUTHORITY_INFO_ACCESS_EXTENSION = 26;
    const OID_SERVER_AUTH_eku = 100;
    const OID_CLIENT_AUTH_eku = 101;
    const OID_CODE_SIGNING_eku = 102;
    const OID_EMAIL_PROTECTION_eku = 103;
    const OID_IPSEC_END_SYSTEM_eku = 104;
    const OID_IPSEC_TUNNEL_eku = 105;
    const OID_IPSEC_USER_eku = 106;
    const OID_TIME_STAMPING_eku = 107;
    const OID_CTL_USAGE_SIGNING_eku = 108;
    const OID_TIME_STAMP_SIGNING_eku = 109;
    const OID_SERVER_GATED_CRYPTO_eku = 110;
    const OID_ENCRYPTING_FILE_SYSTEM_eku = 111;
    const OID_EFS_RECOVERY_eku = 112;
    const OID_WHQL_CRYPTO_eku = 113;
    const OID_NT5_CRYPTO_eku = 114;
    const OID_OEM_WHQL_CRYPTO_eku = 115;
    const OID_EMBEDED_NT_CRYPTO_eku = 116;
    const OID_ROOT_LIST_SIGNER_eku = 117;
    const OID_QUALIFIED_SUBORDINATION_eku = 118;
    const OID_KEY_RECOVERY_eku = 119;
    const OID_DIGITAL_RIGHTS_eku = 120;
    const OID_LICENSES_eku = 121;
    const OID_LICENSE_SERVER_eku = 122;
    const OID_SMART_CARD_LOGON_eku = 123;
    const OID_PKIX_POLICY_QUALIFIER_CPS = 124;
    const OID_PKIX_POLICY_QUALIFIER_USERNOTICE = 125;

    const AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;
    const AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;
    const AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;
    const ATTRIBUTE_OTHER = 0xffffffff;

    const CHECK_NONE = 0;
    const CHECK_TRUSTED_ROOT = 1;
    const CHECK_TIME_VALIDITY = 2;
    const CHECK_SIGNATURE_VALIDITY = 4;
    const CHECK_ONLINE_REVOCATION_STATUS = 8;
    const CHECK_OFFLINE_REVOCATION_STATUS = 16;
    const CHECK_COMPLETE_CHAIN = 32;
    const CHECK_NAME_CONSTRAINTS = 64;
    const CHECK_BASIC_CONSTRAINTS = 128;
    const CHECK_NESTED_VALIDITY_PERIOD = 256;
    const CHECK_ONLINE_ALL = 495;
    const CHECK_OFFLINE_ALL = 503;

    const STRING_TO_UCS2LE = 0;
    const BASE64_TO_BINARY = 0x1;

    const CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0;
    const CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1;
    const CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2;

    const CADES_DEFAULT = 0;
    const CADES_BES = 0x1;
    const CADES_X_LONG_TYPE_1 = 0x5d;
    const CADES_T = 0x5;
    const PKCS7_TYPE = 0xffff;

    const VERIFY_SIGNATURE_ONLY = 0;
    const VERIFY_SIGNATURE_AND_CERTIFICATE = 1;

    const HASH_ALGORITHM_SHA1 = 0;
    const HASH_ALGORITHM_MD2 = 1;
    const HASH_ALGORITHM_MD4 = 2;
    const HASH_ALGORITHM_MD5 = 3;
    const HASH_ALGORITHM_SHA_256 = 4;
    const HASH_ALGORITHM_SHA_384 = 5;
    const HASH_ALGORITHM_SHA_512 = 6;
    const HASH_ALGORITHM_GOSTR_3411 = 100;
    const CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100;
    const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101;
    const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102;
    const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110;
    const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111;
    const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112;

    const XML_SIGNATURE_TYPE_ENVELOPED = 0;
    const XML_SIGNATURE_TYPE_ENVELOPING = 0x1;
    const XML_SIGNATURE_TYPE_TEMPLATE = 0x2;
}
